home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 15851 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  961 b 

  1. Path: news.mindlink.net!news
  2. From: Allan_Nienhuis@mindlink.bc.ca (Allan Nienhuis)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: how many characters have been read from ifstream?
  5. Date: Mon, 08 Apr 1996 14:39:43 GMT
  6. Organization: MIND LINK! - British Columbia, Canada
  7. Message-ID: <4kb89k$2to@fountain.mindlink.net>
  8. References: <DpCyDr.5yK@cdf.toronto.edu>
  9. NNTP-Posting-Host: line013.abb.mindlink.net
  10. X-Newsreader: Forte Free Agent 1.0.82
  11.  
  12. a209dowm@cdf.toronto.edu (P A U L) wrote:
  13.  
  14. >is there any way to check how many characters have been read from an ifstream?
  15.  
  16. >The reason I want to know is because my program is processing a file, and about
  17. >halfway through the file in_stream.eof() returns 1 (the ifstream object is named
  18. >in_stream).  I'm certain that it's only halfway through the file, because I've
  19. >stepped through the program line-by-line.
  20.  
  21. >thanks,
  22. >Paul.
  23.  
  24. try opening the file in binary mode.  you could be reading and eof
  25. character partway thru the file.
  26.  
  27.  
  28.  
  29.